package exp1;

import java.util.Scanner;

public class SumN1 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int sum = 0;
        int aim = sc.nextInt();
        // start
        long stime = System.nanoTime();
        while (aim != 0) {
            sum += aim;
            aim--;
        }
        // end;
        long etime = System.nanoTime();
        System.out.println(sum);
        System.out.println(etime - stime);
    }
}